<?php
declare(strict_types=1);
namespace app\service;

use think\contract\LogHandlerInterface;
use app\admin\model\Operate as OperateDB;
class LogData implements LogHandlerInterface
{
    /**
     * 日志写入接口
     * @access public
     * @param  array $log 日志信息
     * @return bool
     */
    public function save(array $log): bool        
    {
        try {
            //code...
            $data = $log['info'][0];
            $create = OperateDB::create($data);
            return empty($create) ? false : true;
        } catch (\Throwable $th) {
            //throw $th;
            return false;
        }
    }

}
